home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
301-325
/
disk_319
/
cnewssrc
/
cnews.orig.lzh
/
expire
/
histslash.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-27
|
695b
|
37 lines
/*
* Convert slashed filenames to dotted group/article names in a history
* file, for use in mkhistory. Input comes only from stdin.
*/
#include <stdio.h>
#include <assert.h>
char *progname = "histslash";
char buf[4096]; /* paranoia -- ought to be lots */
main()
{
register char *scan;
register char *last;
extern char *strchr();
while (fgets(buf, sizeof(buf), stdin) != NULL) {
scan = strchr(buf, '\t');
scan = strchr(scan+1, '\t');
scan++;
last = NULL;
while (*scan != '\0') {
if (*scan == '/') {
*scan = '.';
last = scan;
}
if (*scan == ' ' || *scan == '\n') {
assert(last != NULL);
*last = '/';
}
scan++;
}
fputs(buf, stdout);
}
}